﻿<%@ Page Language="C#" MasterPageFile="~/mychau_admin/AdminMasterPage.master" AutoEventWireup="true"
    CodeFile="TinTuc.aspx.cs" Inherits="mychau_admin_common_TinTuc" Title="Untitled Page" %>
<%@ Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div>
        <h3>
            Quản lý chuyên mục tin tức</h3>
    </div>
    <div>
        <div>
            <asp:Label ID="lblAddOrEdit" runat="server"></asp:Label>
        </div>
        <div>
            <asp:Panel ID="pnlAddTinTuc" runat="server">
                <table>
                    <tr>
                        <td>
                            <asp:Label ID="lblTieuDeAdd" runat="server" Text="Tiêu đề"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtTieuDeAdd" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblNoidungAdd" runat="server" Text="Nội dung"></asp:Label>
                        </td>
                        <td>
                            <CKEditor:CKEditorControl ID="ckeNoiDungAdd" runat="server"></CKEditor:CKEditorControl></td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblNguoiDangAdd" runat="server" Text="Người đăng"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtNguoiDangAdd" runat="server" /></td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblNguonAdd" runat="server" Text="Nguồn"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtNguonAdd" runat="server" /></td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblImage1Add" runat="server" Text="Ảnh"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtImage1Add" runat="server" /></td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblImage2Add" runat="server" Text="Ảnh"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtImage2Add" runat="server" /></td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblImage3Add" runat="server" Text="Ảnh"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtImage3Add" runat="server" /></td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblImage4Add" runat="server" Text="Ảnh"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtImage4Add" runat="server" /></td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblImage5Add" runat="server" Text="Ảnh"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtImage5Add" runat="server" /></td>
                    </tr>
                    <tr>
                        <td colspan="2" align="right">
                            <asp:Button ID="btnAddTinTuc" runat="server" Text="Thêm" OnClick="btnAddTinTuc_Click" />
                            <asp:Button ID="btnCancelAddTinTuc" runat="server" Text="Nhập lại" OnClick="btnCancelAddTinTuc_Click" />
                        </td>
                    </tr>
                </table>
            </asp:Panel>
            <asp:Panel ID="pnlEditTinTuc" runat="server">
                <table>
                    <tr>
                        <td>
                            <asp:Label ID="lblTieuDeEdit" runat="server" Text="Tiêu đề"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtTieuDeEdit" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblNoiDungEdit" runat="server" Text="Nội dung"></asp:Label>
                        </td>
                        <td>
                            <CKEditor:CKEditorControl ID="ckeNoiDungEdit" runat="server"></CKEditor:CKEditorControl></td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblNguoiDangEdit" runat="server" Text="Người đăng"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtNguoiDangEdit" runat="server" /></td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblNguonEdit" runat="server" Text="Nguồn"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtNguonEdit" runat="server" /></td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblImage1Edit" runat="server" Text="Ảnh"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtImage1Edit" runat="server" /></td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblImage2Edit" runat="server" Text="Ảnh"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtImage2Edit" runat="server" /></td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblImage3Edit" runat="server" Text="Ảnh"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtImage3Edit" runat="server" /></td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblImage4Edit" runat="server" Text="Ảnh"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtImage4Edit" runat="server" /></td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblImage5Edit" runat="server" Text="Ảnh"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtImage5Edit" runat="server" /></td>
                    </tr>
                    <tr>
                        <td colspan="2" align="right" style="height: 26px">
                            <asp:Button ID="btnEditTinTuc" runat="server" Text="Sửa" OnClick="btnEditTinTuc_Click" />
                            <asp:Button ID="btnCancelEditTinTuc" runat="server" Text="Hủy" OnClick="btnCancelEditTinTuc_Click" />
                        </td>
                    </tr>
                </table>
            </asp:Panel>
        </div>
        <p style="color: Red;">
            <asp:Label ID="lblError" runat="server"></asp:Label>
        </p>
        <div>
            <asp:DataList ID="dtlTinTuc" runat="server" DataKeyField="ID" OnDeleteCommand="dtlTinTuc_DeleteCommand" OnEditCommand="dtlTinTuc_EditCommand">
                <HeaderTemplate>
                    <table class="viewTable">
                        <tr>
                            <th>
                                Sửa
                            </th>
                            <th>
                                Xóa
                            </th>
                            <th>
                                Mã tin tức
                            </th>
                            <th>
                                Tiêu đề
                            </th>
                            <th>
                                Nội dung
                            </th>
                            <th>
                                Ngày đăng
                            </th>
                            <th>
                                Người đăng
                            </th>
                            <th>
                                Nguồn
                            </th>
                            <th>
                                Ảnh
                            </th>
                            <th>
                                Ảnh
                            </th>
                            <th>
                                Ảnh
                            </th>
                            <th>
                                Ảnh
                            </th>
                            <th>
                                Ảnh
                            </th>
                        </tr>
                </HeaderTemplate>
                <ItemTemplate>
                    <tr>
                        <td>
                            <asp:LinkButton ID="lbtnEdit" runat="server" CommandName="Edit">
                                <asp:Image ID="imgEdit" runat="server" ImageUrl="~/images/Img_Admin/edit.gif" /></asp:LinkButton>
                        </td>
                        <td>
                            <asp:LinkButton ID="lbtnDelete" runat="server" CommandName="Delete" Style="position: relative"
                                OnClientClick="return confirm('Are you sure want delete this category?');">
                                <asp:Image ID="imgDelete" runat="server" ImageUrl="~/images/Img_Admin/delete.gif" /></asp:LinkButton>
                        </td>
                        <td>
                            <asp:Label ID="lblNewsID" Text='<%#Eval("ID") %>' runat="server"></asp:Label>
                        </td>
                        <td>
                            <%#Eval("tieuDe")%>
                        </td>
                        <td>
                            <%#Eval("noiDung") %>
                        </td>
                        <td>
                            <%#Eval("ngayDang") %>
                        </td>
                        <td>
                            <%#Eval("nguoiDang") %>
                        </td>
                        <td>
                            <%#Eval("nguon") %>
                        </td>
                        <td>
                            <%#Eval("image1") %>
                        </td>
                        <td>
                            <%#Eval("image2") %>
                        </td>
                        <td>
                            <%#Eval("image3") %>
                        </td>
                        <td>
                            <%#Eval("image4") %>
                        </td>
                        <td>
                            <%#Eval("image5") %>
                        </td>
                    </tr>
                </ItemTemplate>
                <FooterTemplate>
                    </table>
                </FooterTemplate>
            </asp:DataList>
        </div>
    </div>
</asp:Content>
